package com.devsoft.foodflip;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Food {
	

	private String name;
	private int pos_x;
	private int pos_y;
	private int cooked = 0;			//food drops uncooked, the more its flipped, the more cooked
	private int cookedMax = 3;		//after 3 hits, the food is fully cooked
	private double weight;			//each food has unique weight, reps approx lbs
	private boolean bounce = false;	//when false, food is falling 
	private boolean fullyCooked = false;
	private Bitmap image; 			//used to hold image of food
	private Context context;
	
	public Food(){}
	
	public Food(String name, double weight, Bitmap image)//, Bitmap image
	{
		this.name = name;
		this.weight = weight;
		this.image = image;
	}
	
	
	public Food(Context context)
    {
         this.context = context;
         
    }
	
	
	public String getName()
	{
		return name;
		
	}
	
	
	public int getPositionX()
	{
		return pos_x;
		
	}
	
	
	public int getPositionY()
	{
		return pos_y;
		
	}
	
	
	public void setPositionX(int pos)
	{
		this.pos_x = pos;
		
	}
	
	
	public void setPositionY(int pos)
	{
		this.pos_y = pos;
		
	}
	
	public void incrementCooked(int cooked)
	{
		this.cooked = cooked++;
		
		if (this.cooked == cookedMax)
		{
			fullyCooked = true;
			//remove food from current arraylist in game of food in air and add appropriate points to player score
			
		}
		
	}
	
	
	public double getWeight()
	{
		return weight;
		
	}
	
	
	public int getCooked()
	{
		return cooked;
		
	}
	
	
	public int getCookedMax()
	{
		return cookedMax;
		
	}
	
	
	public boolean getBounce()
	{
		return bounce;
		
	}
	
	public void setBounce(boolean state)
	{
		this.bounce = state;
		
	}
	
	
	public boolean getFullyCooked()
	{
		return fullyCooked;
		
	}
	
	
	public Bitmap getImage()
	{
		return image;
		
	}
	
	
	public ArrayList <Food> removeFood(ArrayList <Food> currentFood, Food foodCooked)	//removes food fully cooked on screen
	{
		currentFood.remove(foodCooked);
		
		//add points to player score
		
		return currentFood;
		
	}
	
	
	public ArrayList <Food> generateFood()
	{
		Food con = new Food(context);
		
		Food Bananas = new Food("Bananas", 2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_bananas));
		Food Bellpepper = new Food("Bellpepper", .2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_bellpepper));
		Food Burger = new Food("Burger", 1, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_burger));
		Food Carrot = new Food("Carrot", .2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_carrot));
		Food Cherry = new Food("Cherry", .1, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_cherry));
		Food Chicken = new Food("Chicken", .5, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_chicken));
		Food Corndog = new Food("Corndog", .5, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_corndog));
		Food Donut = new Food("Donut", .5, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_donut));
		Food Egg = new Food("Egg", .2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_egg));
		Food Eggplant = new Food("Eggplant", 1, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_eggplant));
		Food Grapes = new Food("Grapes", .5, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_grapes));
		Food Lemon = new Food("Lemon", .2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_lemon));
		Food Mushroom = new Food("Mushroom", .2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_mushroom));
		Food Pineapple = new Food("Pineapple", 2, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_pineapple));
		Food Strawberry = new Food("Strawberry", .1, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_strawberry));
		Food Sushi = new Food("Sushi", .5, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_sushi));
		Food Tomato = new Food("Tomato", 1, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_tomato));
		Food Watermelon = new Food("Watermelon", 3, BitmapFactory.decodeResource(context.getResources(), R.drawable.food_watermelon));
		
		ArrayList <Food> foodList = new ArrayList <Food>();
		
		foodList.add(Bananas);
		foodList.add(Burger);
		foodList.add(Carrot);
		foodList.add(Cherry);
		foodList.add(Chicken);
		foodList.add(Corndog);
		foodList.add(Donut);
		foodList.add(Egg);
		foodList.add(Eggplant);
		foodList.add(Grapes);
		foodList.add(Lemon);
		foodList.add(Mushroom);
		foodList.add(Bellpepper);
		foodList.add(Pineapple);
		foodList.add(Strawberry);
		foodList.add(Sushi);
		foodList.add(Tomato);
		foodList.add(Watermelon);
		
		return foodList;
		
	}

}
